const Koa = require('koa')
const app = new Koa()
app.use((ctx, next) => {
  if (ctx.request.url === '/login') {
    if (ctx.request.method === 'GET') {
      ctx.response.body = 'login success'
    }
  } else {
    ctx.response.body = 'hello world'
  }
  console.log('ctx===', ctx)
})
app.listen(6029, () => {
  console.log('koa初体验 server')
})